package com.janj.controller;

import com.janj.bean.Grade;
import com.janj.bean.Student;
import com.janj.service.GradeOnStudentService;
import com.janj.service.GradeOnStudentServiceImpl;
import org.junit.Test;

import java.util.List;

public class GradeOnStudentDemo {


    @Test
    public void testSelectGradeOnStudent(){
        GradeOnStudentService service = new GradeOnStudentServiceImpl();
        List<Grade> array = service.selectGradeOnStudent();
        System.out.println("-----------------");
        for (Grade g : array) {
            String gname = g.getGname();
            List<Student> list = g.getStudents();
            for (Student stu : list) {
                String sname = stu.getSname();
                Integer age = stu.getAge();
                System.out.println(gname+","+sname+","+age);
            }
        }
    }
}
